package com.sybkl.bigdatastudentmybatisplus.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sybkl.bigdatastudentmybatisplus.entity.Award;
import com.sybkl.bigdatastudentmybatisplus.service.AwardService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/award")
public class AwardController {

    @Autowired
    private AwardService awardService;

    @GetMapping("/{stu_id}")
    public List<Award> findAllById(@PathVariable String stu_id) {
        QueryWrapper<Award> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("stu_id", stu_id);
        return awardService.list(queryWrapper);
    }


}
